ShowTable of Contents
The Sametime Controls are included in Social Enabler of XPages Extension Library. With the Sametime controls you can include Sametime awareness and instant message function in you XPages application easily. The Social Enbler Sametime controls leverages Sametime Web Client technology which were introduced in Sametime 8.5. The Sametime Web Client technology provided Dojo based web client user experience based on Dojo Library and available with Sametime Proxy server component.
This article explains how to included Sametime livename and Web Client components in to your XPages application with using Social Enable Sametime Controls of XPages Extension Library. The content of this article are create based on XPages Extension Library on Domino and Domino Designer 8.5.3.
FQHN for Domino
When you are trying Sametime connectivity of Social Enabler in XPages Extension Library, its UI may not be displayed correctly because of cross-site-scripting restriction. To avoide this problem you have to configure your Domino to be accesable with FQHN with the same domain with Sametime.
For example, as Lotus Greenhouse's sametime is accesable with greenhouse.lotus.com, your Domino have to be configure to be accessable with my_domino.lotus.com. This configuration can be done via Domino configuratoin, or you can just add my_domino.lotus.com entry in your client's hosts file.
Configuration of the Social Enabler environment for Sametime
Installing XPages Extension Library
The standard installation procedure for XPages Extension Library are described in the following article:
After installatin of XPages Extension Library, execute the following procedure to create "OAuth Token Store" database:
-
Copy the WebSecurityStore.ntf to you Domino data folder from XPages Extension Library package.
-
Open the WebSecurityStore.ntf with your Domino Administraion Client or Domino Designer and sign the template.
-
Create WebSecurityStore.nsf application (do not change the filename) with your favolite application name from the template.
Social Enabler allows your XPages application connects to many Social and Cloud services, and some additional configuration might be required for connecting certain services after installing XPages Extension Library. However for Sametime connection, required configuration are already included XPages Extension Library sample application for Lotus Greenhouse
Sametime service and you can try the Sametime connectivity just after installation.
Completing the installation of XPages Extension Library, now you can try the Sametime connectivity of Social Eanbler. Before trying sample application, make sure that you have account on the
Lotus Greenhouse
. The sample application use the Sametime server on
Lotus Greenhouse
.
Try the Social Enabler sample application
The Social Enabler sample application is provided as XPagesSBT.nsf in XPages Extension Library release package. Try the Sametime Control sample with the following steps:
-
Copy the XPagesSBT.nsf to you Domino data folder
-
Open the XPagesSBT.nsf with your Domino Administration Client or Domino Designer and sign the application. Then add appropriate ACL entry to the NSF file for test access. But it is recommended no to allow anonymous access to the application, because user's authentication info (username and password) will be stored in "OAuth Token Store" database (WebSecurityStore.nsf) associated with authenticated Domino user name.
-
On Web browser, open the NSF file with the URL: http:///XPagesSBT.nsf/
-
Click "Sametime" tab to open Samtime Control sample page.
-
As "Livename" section is selected in the left pane, click "Login" link or "Login to Sametime" link. Then type in your username and password for Lotus Greenhouse on login dialog or login pane.
-
When you have successfully logged in, your names are displayed with Sametime status as Live name
Now you Social enbler environment are configured for Sametime and verified it works.
Controls for connecting Sametine in Social Enabler
In Social Enabler environment, you have two Sametime specific controls and one generic control to display Sametime Livename and WebClient on you XPages Application
Category |
Control name |
Description |
Core Controls |
Computed Field |
With specifying designated contentType attribute, this control can show Sametime Livename. |
Social Business Toolkit |
Sametime Client |
This control loads the desired Sametime resources with the page. If the resources are not loaded, then none of the Sametime widgets will be rendered. |
|
Sametime Widget |
This control instanciate a Dojo dijit in relationship with the sametime client. It does not render if no sametime client already rendered in the page. |
Although the Sametime Client Control would not show any UI component, it is always used along with other controls. The Computed Field Control can be used to show Sametime Livename and Sametime Widget Control is used to show Sametime Livename or Sametime Web Client Widget.
Preparing your application to including Sametime Controls
Configure your application before using Sametime Controls
To included the Sametime Controls in you application, you have to configure your application to work with Social Enabler.
-
Open Application Properties and select "Advanced" tab, the check the following two libraries in "XPages Libraries" seciotn
-
com.ibm.xsp.extlib.library
-
com.ibm.xsp.extlibx.library
-
On "XPages" tab, it is recommended to specify "oneuiv2.1" for "Application Theme" of "Theme Defaults" section. It will make Social Enabler UI component to be show better.
Add Endpoint Configuration
The endpoint configuration tell Social Enabler component to where the Sametime connection will be established. The faces-config.xml file contains the managed bean configurations for JavaServer Faces container and endpoint is defined as attribute of the managed bean.
To see the faces-config.xml, you have to open Package Explorer view by selecting [Window] - [Show Eclipse Views ] - [Package Explorer], then open
\WEB-INF folder in the Package Explorer view. If you are just trying to connect to the Lotus Greenhouse Sametime server from your application, you can copy the contents from faces-config.xml in XPagesSBT.nsf to your application. Two managed-bean definitions of "PwdStore" and "greenhouseSametime"are required to use the Sametime connection.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config>
<!--
Password store physical implementation.
-->
<managed-bean>
<managed-bean-name>PwdStore</managed-bean-name>
<managed-bean-class>com.ibm.xsp.extlib.sbt.security.password.store.BANSFPasswordStore
</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>database</property-name>
<value>WebSecurityStore.nsf</value>
</managed-property>
</managed-bean>
<!--
Greenhouse Sametime
-->
<managed-bean>
<managed-bean-name>greenhouseSametime</managed-bean-name>
<managed-bean-class>com.ibm.xsp.extlib.sbt.services.client.endpoints.SameTimeEndpoint
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>url</property-name>
<value>https://greenhouse.lotus.com</value>
</managed-property>
<managed-property>
<property-name>passwordStore</property-name>
<value>PwdStore</value>
</managed-property>
<managed-property>
<property-name>authenticationPage</property-name>
<value>_BasicLogin?endpoint=greenhouseSametime</value>
</managed-property>
</managed-bean>
</faces-config>
The endpoint defined here is needed to be added to xsp.properties file. In same folder with faces-config.xml, you can find xsp.properties. Open xsp.properties, add the following line and save it.
extlib.endpoint.sametime=greenhouseSametime
Copy re-usable XPage and Custom Controls
The XPagesSBT.nsf sample application contains re-usable XPage and Custom Controls which will help you to develop you Sametime connectivity development. We recommend you to copy the following re-usable components into you application.
Design Element |
Design Name |
Description |
XPage |
_BasicLogin.xsp |
Basic login page with user name and password. |
Custom Controls |
BasicAuthenticationPanel.xsp |
Provides a link to open _BasciLogin.xsp |
|
sbtLoginDialog.xsp |
Provides link to open login dialog |
|
sbtLoginPage.xsp |
Sub component used in _BasicLogin.xsp |
|
sbtLoginPanel.xsp |
Sub component used in sbtLoginDialog.xsp and sbtLoginSection.xsp |
|
sbtLoginSection.xsp |
Provides link to open login section |
Including Sametime Controls in you application
Now you can included Sametime Controls into your application. This section explains the following topics:
-
Adding login page to Sametime
-
Adding Livename component with using Computed Field Control
-
Adding Livename component with using Sametime Widget Control
-
Adding Web Client with using Sametime Widget Control
In any case, Sametime Client Controls have to be included to creates the sametime client. It holds the Sametime parameters for different Sametime components and is required on the page to use the Sametime features. If it is not on the page, or not rendered, then the other Sametime controls will behave like if they're not connected to Sametime server.
Adding login page to Sametime
The Social Enabler Sametime connectivity allow your application login to Sametime server with basic authentication with username and password. Using one of he following three Custom Controls, you can add Sametim login page in your XPages Aplication:
"BasicAuthenticationPanel" Custom Control
You have to specify the following Custom Properties:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:sametimeClient id="sametimeClient1" autoLogin="true"
clientScriptFile="livename" autoTunnelURI="true">
</xe:sametimeClient>
<xc:BasicAuthenticationPanel endpoint="sametime"></xc:BasicAuthenticationPanel>
</xp:view>
"sbtLoginDialog" Custom Control
You have to specify the following Custom Properties:
-
dialogTitle
-
Label
-
endpoint
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:sametimeClient id="sametimeClient1" autoLogin="true"
clientScriptFile="livename" autoTunnelURI="true">
</xe:sametimeClient>
Login Dialog:
<xc:sbtLoginDialog id="loginDialog" dialogTitle="Login To Sametime"
endpoint="sametime" label="Login To Sametime">
</xc:sbtLoginDialog>
</xp:view>
"sbtLoginSection" Custom Control
You have to specify the following Custom Properties:
-
dialogTitle
-
Label
-
endpoint

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:sametimeClient id="sametimeClient1" autoLogin="true"
clientScriptFile="livename" autoTunnelURI="true">
</xe:sametimeClient>
Login Section:
<xc:sbtLoginSection id="sbtLoginSection1"
sectionTitle="Login To Sametime" endpoint="sametime" label="Login To Sametime">
</xc:sbtLoginSection>
</xp:view>
Computed Filed Control can be used to display Livename by specifing contentType="xs:st.livename"
The value format is "Sametime User ID | Display Name".
To get my own ID, the following script @Endpoint("sametime").getUserIdentity() can be used:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:sametimeClient id="sametimeClient1" autoLogin="true"
clientScriptFile="livename" autoTunnelURI="true">
</xe:sametimeClient>
Here is an example with the id and a display name set:
<xp:text escape="true" id="computedField3" contentType="xs:st.livename">
<xp:this.value><![CDATA[#{javascript:@Endpoint("sametime").getUserIdentity()+"|[user display name]"}]]></xp:this.value>
</xp:text>
</xp:view>
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:sametimeClient id="sametimeClient1" autoLogin="true"
clientScriptFile="livename" autoTunnelURI="true">
</xe:sametimeClient>
Here is an example using a sametime widget:
<xe:sametimeWidget id="sametimeWidget1" dojoType="sametime.LiveName">
<xe:this.dojoAttributes>
<xp:dojoAttribute name="userId">
<xp:this.value><![CDATA[#{javascript:@Endpoint("sametime").getUserIdentity()}]]></xp:this.value>
</xp:dojoAttribute>
</xe:this.dojoAttributes>
</xe:sametimeWidget>
<xp:br></xp:br>
</xp:view>
Sametime Web Client can be added using Ssmetimg Widget Control with dojoType="sametime.WebClient" attribute.